<link rel="stylesheet" type="text/css" href="/static/My97DatePicker/skin/WdatePicker.css" />
     <script charset="utf-8" src="/static/My97DatePicker/WdatePicker.js"></script>
    
    <section class="topBanners">
         <div class="icon"></div>
         <div class="topBannersNav">
          <span data-url="/admin/devlist/lists" data-container="rt_content"   class="topBannerItem">资产列表</span>
         >
         <span data-url="/admin/devlist/infoData" data-container="rt_content" data-param-id="<?php echo $id;?>"   class="topBannerItem">资产详情</span>
         >
         <span data-url="/admin/devlist/baoxiulog" data-container="rt_content" data-param-id="<?php echo $id;?>"    class="topBannerItem">报修查询</span>
         </div>
      </section>
      
      <section style="margin-top:10px;margin-left:auto;margin-right:auto;">
          报修时间：
          <input name="starttime"  id="starttime" class="Wdate textbox" placeholder="开始时间"  onfocus="WdatePicker({lang:'zh-cn'})" value="<?php echo $request['starttime']; ?>" size="12"  type="text" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;" >
          -<input name="endtime" id="endtime" class="Wdate textbox" placeholder="结束时间"  onfocus="WdatePicker({lang:'zh-cn'})" value="<?php echo $request['endtime']; ?>" size="12" type="text" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;" >
      状态：<select name="stat" id="stat" class="select">
       <option value="">--选择--</option>
       <option value="0" <?php if($request['stat']=='0'){ echo 'selected';} ?> >待处理</option>
       <option value="1" <?php if($request['stat']=='1'){ echo 'selected';} ?> >等待</option>
       <option value="2" <?php if($request['stat']=='2'){ echo 'selected';} ?> >受理</option>
       <option value="3" <?php if($request['stat']=='3'){ echo 'selected';} ?> >拒绝</option>
       <option value="4" <?php if($request['stat']=='4'){ echo 'selected';} ?> >完结</option>
      </select>
      <input type="button" value="搜索" class="group_btn research" id="resource" page="1" />
      
      <br style="clear:both;width:0px;height:0px;">
      <input type="hidden" name="zcID" id="zcID" value="<?php echo $id; ?>" />
     </section>
   
<table class="table" style="margin-top:10px;">

<tr>
<th><input id="all" type="checkbox"></th>
<th style="60px">ID</th>
<th style="150px">资产信息</th>
<th style="150px">报修人信息</th>
<th style="150px">处理人信息</th>
<th style="80px">进度</th>
<th style="150px">秒素</th>
<th style="100px">创建时间</th>
<th style="100px">处理时间</th>
</tr>

<?php 
foreach($lists['data'] as $key=>$val)
{
?>
<tr data-id="<?php echo $val['id']; ?>">

<td style="text-align:center;">
<input type="checkbox" value="<?=$val['id']?>" class="checkBoxInput" name="checked[]" /></td>
<td><?php echo $val['id'];?></td>
<td style="text-align:center;">
<?php
 echo $val['devlistInfo']['dvename']."<br>";
 echo "[".$val['devlistInfo']['dveid']."]";
 ?>
</td>

<td style="text-align:center;">
<?php
if($val['tuserInfo'])
{
 //echo $val['tuserInfo']['uname']." ";

 echo "[".$val['tuserInfo']['nickname']."]<br>";
 echo "[".$userDepList[$val['tuserInfo']['first_depid']]['depname']."]";
 echo "[".$userDepList[$val['tuserInfo']['depid']]['depname']."]";
}
 ?>
</td>

<td style="text-align:center;">
<?php
if($val['duserInfo'])
{
 //echo $val['duserInfo']['uname']." ";

 echo "[".$val['duserInfo']['nickname']."]<br>";
 echo "[".$userDepList[$val['duserInfo']['first_depid']]['depname']."]";
 echo "[".$userDepList[$val['duserInfo']['depid']]['depname']."]";
}
 ?>
</td>


<td>
<?php
if($val['stat']==1)
{
  echo '等待';
}else if($val['stat']==2)
{
  echo '受理';
}else if($val['stat']==3)
{
  echo '拒绝';
}
else if($val['stat']==4)
{
  echo '完成';
}
else if($val['stat']==0)
{
  echo '提交';
}
?>
</td>

<td>
<?php
if($val['conts'])
{
	echo $val['conts'];
}
?>
</td>




<td><?php
if(!empty($val['ctime']))
{
 echo date("Y-m-d H:i:s",$val['ctime']);
}
 ?></td>
 <td><?php
if(!empty($val['etime']))
{
 echo date("Y-m-d H:i:s",$val['etime']);
}
 ?></td>

</tr>
      <?php
      }
	  ?>
</table>
{include file="../application/admin/view/layout/page_tpl_new.html" /}
      <script type="text/javascript">
      
      function myResearch(){
		   var url="/admin/devlist/baoxiulog";
		   var starttime =$("#starttime").val();
		   var endtime =$("#endtime").val();
		   var id =$("#zcID").val();
		   var stat =$("#stat").val();
        if(starttime!="" && endtime=="")
       {
          ErrTiShi("请选择结束日期");return false;
       }
       if(starttime=="" && endtime!="")
       {
          ErrTiShi("请选择开始日期");return false;
       }
		
		   var page=$("#cpage").val();
		   var param={
				   starttime:starttime, 
				   endtime:endtime, 
				   stat:stat, 
				   id:id, 
				   page:page
		   };
		   ContentGet(url,param);
	   }
     
      
           $(function(){
        	   //设置搜索栏
        	   $(".research").click(function(){
        		   var page =$(this).attr("page");
        		   $("#cpage").val(page);
        		   myResearch();
        		   
        	   });
        	   
        	   //删除项
        	   $('.del').click(function(){
        		   var that =this;
        		   var url="/admin/job/delData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		   cofirmsss_tishi(1,'您确定要删除吗?',function(id){
        			 
        			   AjaxRequest(url,param,function(data){
            			   if(data.err==0)
            			   {
            				   SuccessTiShi("操作成功");
            				   
            				   $(that).parent().parent().remove();
            				   myResearch();
            			   }
            			   else
            			   {
            				   ErrTiShi("操作失败");
            			   }
            		   });
        			   
        		   });
        	   });
        	   
        	 //启用
        	   $('.qy').click(function(){
        		   var that =this;
        		   var url="/admin/job/qyData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		   cofirmsss_tishi(1,'您确定要启用吗?',function(id){
        			 
        			   AjaxRequest(url,param,function(data){
            			   if(data.err==0)
            			   {
            				   SuccessTiShi("操作成功");
            				   $(that).val("禁用");
            				  
            				 
            				  $(that).parent().parent().find(".dataStat").html("正常");
            				   $(that).removeClass("qy");
            				   $(that).addClass("jy");
            				   myResearch();
            			   }
            			   else
            			   {
            				   ErrTiShi("操作失败");
            			   }
            		   });
        			   
        		   });
        	   });
        	 
        	 
        	 //二级部门
        	   $('.nextDep').click(function(){
        		   var that =this;
        		   var url="/admin/job2/lists";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   pid:id
        		   };
        		   ContentGet(url,param);
        	   });
        	 
        	   //禁用
        	   $('.jy').click(function(){
        		   var that =this;
        		   var url="/admin/job/jyData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		   cofirmsss_tishi(1,'您确定要禁用吗?',function(id){
        			 
        			   AjaxRequest(url,param,function(data){
            			   if(data.err==0)
            			   {
            				   SuccessTiShi("操作成功");
            				   $(that).val("启用");
            				   
            				   $(that).parent().parent().find(".dataStat").html("禁用");
            				   $(that).removeClass("jy");
            				   $(that).addClass("qy");
            				   myResearch();
            			   }
            			   else
            			   {
            				   ErrTiShi("操作失败");
            			   }
            		   });
        			   
        		   });
        	   });
        	   //编辑项
        	   $(".edit").click(function(){
        		   var that =this;
        		   var url="/admin/job/editData";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		   MyContentLoad(url,param);
        				 
        				
        			 //弹出：确认按钮
        			
        	   });

        	   $(".resetPwd").click(function(){
        		   var that =this;
        		   var url="/admin/job/resetPwd";
        		   var id=$(that).parent().parent().attr('data-id');
        		   var param={
        				   id:id
        		   };
        		   MyContentLoad(url,param);
        				 
        				
        			 //弹出：确认按钮
        			
        	   });
        	   
        	   
        	   
        	   //编辑项
        	   $(".add").click(function(){
        		   
        		   var that =this;
        		   var url="/admin/job/addData";
        		   var param={};
        		   MyContentLoad(url,param);
        			 //弹出：确认按钮
        			
        	   });
        	   
        	   //导航
         	   $(".topBannerItem").click(function(){
         		   
         		   var attArr = $(this).attr();
             	   goToSelfLink(attArr);
             	   
         			
         	   });
  			   //全选
  		
  				$("#all").click(function(){   
			    	if(this.checked){   
			        	$(".checkBoxInput").attr("checked", true);  
			        	$(".checkBoxInput").prop("checked", true);  
			    	}else{   
						$(".checkBoxInput").attr("checked", false);
						$(".checkBoxInput").prop("checked", false);
			    	}   
			    	var se=getAllSelectItem();
			    	//console.log(se);
			 	}); 
  			   
  			
           });
           
	  </script>
   